target_sources(spark-net
    PRIVATE
        Impl/Acceptor.cpp
        Impl/Connector.cpp
        Impl/EpollPoller.cpp
        Channel.cpp
        EventLoop.cpp
        EventLoopThread.cpp
        EventLoopThreadPool.cpp
        MsgBuffer.cpp
        Poller.cpp
        Socket.cpp
        SocketAddr.cpp
        TcpClient.cpp
        TcpConnection.cpp
        TcpServer.cpp
        Timer.cpp
        TimerQueue.cpp
        Timingwheel.cpp
)

target_link_libraries(spark-net
    PUBLIC
        spark-utils
        Threads::Threads
)

if(BUILD_TEST)
    add_subdirectory(Test)
endif()

set_target_properties(spark-net
PROPERTIES
    PUBLIC_HEADER
"${CMAKE_CURRENT_LIST_DIR}/CallbackDefs.h;\
${CMAKE_CURRENT_LIST_DIR}/Channel.h;\
${CMAKE_CURRENT_LIST_DIR}/EventLoop.h;\
${CMAKE_CURRENT_LIST_DIR}/EventLoopThread.h;\
${CMAKE_CURRENT_LIST_DIR}/EventLoopThreadPool.h;\
${CMAKE_CURRENT_LIST_DIR}/Poller.h;\
${CMAKE_CURRENT_LIST_DIR}/Socket.h;\
${CMAKE_CURRENT_LIST_DIR}/SocketAddr.h;\
${CMAKE_CURRENT_LIST_DIR}/MsgBuffer.h;\
${CMAKE_CURRENT_LIST_DIR}/IgnoreSignal.h;\
${CMAKE_CURRENT_LIST_DIR}/TcpConnection.h;\
${CMAKE_CURRENT_LIST_DIR}/TcpClient.h;\
${CMAKE_CURRENT_LIST_DIR}/TcpServer.h;\
${CMAKE_CURRENT_LIST_DIR}/TimerQueue.h;\
${CMAKE_CURRENT_LIST_DIR}/Timer.h;\
${CMAKE_CURRENT_LIST_DIR}/Timingwheel.h"
    PRIVATE_HEADER
"${CMAKE_CURRENT_LIST_DIR}/Impl/Acceptor.h;\
${CMAKE_CURRENT_LIST_DIR}/Impl/Connector.h;\
${CMAKE_CURRENT_LIST_DIR}/Impl/EpollPoller.h"
)